export default {
  namespaced: true,
  state: () => ({
    token: '',
  }),
  mutations: {
    setToKen(state, newToKen) {
      state.token = newToKen;
      window.localStorage.setItem('token', newToKen);
    },
    // 初始化 
    initToKen(state) {
      state.token = window.localStorage.getItem('token');
    },
    reToKen(state, empty) {
      state.token = empty;
      window.localStorage.removeItem('token');
    },
  }
}